package com.ucex.common.rocketmq.producer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ucex.common.rocketmq.MQProperties;
import com.ucex.common.rocketmq.domain.MessageEntity;
import com.ucex.common.rocketmq.producer.ali.AbstractMessageProducerProcess;

/**
 * 供第三方调用发送消息
 * 
 */
@Component
public class MessageProducer {


    private AbstractMessageProducerProcess messageProducerProcess;

    @Autowired
    public MessageProducer(MQProperties properties) {
        this.messageProducerProcess = AliMQProducerProcess.getInstance();
        this.messageProducerProcess.init(properties);
    }

    public void send(MessageEntity me) {
        messageProducerProcess.pushMessageToQueue(me);
    }
}
